import React, { useState } from 'react';
import './MySearch.scss'
import { Space, Button, Input } from 'antd';
interface Props {
    handleSearch: any
}

function MySearch(props: Props) {
    let [searchText, setSearchText] = useState('')

    let handleChange = (e: any) => {
        setSearchText(e.target.value)
    }


    return (
        <div>
            <Input placeholder='请输入关键字' value={searchText} onChange={(e) => { handleChange(e) }} />
            <Button className='sousuo' type="primary" onClick={() => { props.handleSearch(searchText) }} >搜索</Button>
        </div>
    );
}

export default MySearch;